<template>
    <div class="qingwu">
        <div class="admin_table_page_title">
            <a-button @click="$router.back()" class="float_right" icon="arrow-left">返回</a-button>
            公司及联系人信息
        </div>
        <div class="unline underm"></div>
        <div class="admin_form">
            <a-form-model :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }">
                <a-form-model-item label="物业名称">
                    <a-input v-model="info.name"></a-input>
                </a-form-model-item>

                <a-form-model-item label="登陆账号">
                    <a-input v-model="info.account"></a-input>
                </a-form-model-item>

                <a-form-model-item label="登陆密码">
                    <a-input type="password" placeholder="不修改密码请留空" v-model="info.password"></a-input>
                </a-form-model-item>

                <a-form-model-item label="企业详细地址">
                    <a-input v-model="info.address"></a-input>
                </a-form-model-item>

                <a-form-model-item label="负责人">
                    <a-input v-model="info.principal"></a-input>
                </a-form-model-item>

                <a-form-model-item label="负责人联系电话">
                    <a-input v-model="info.principal_mobile"></a-input>
                </a-form-model-item>
            </a-form-model>
        </div>
        <div class="admin_table_page_title">
            配送信息
        </div>

        <div class="unline underm"></div>
        <div class="admin_form">
            <a-form-model :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }">
                <a-form-model-item label="配送费用">
                    <a-input v-model="info.shipping"></a-input>
                </a-form-model-item>
            </a-form-model>

            <a-form-model :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }">
                <a-form-model-item label="自动结算时间">
                    <a-input v-model="info.settlement_time"></a-input>
                    <a-span>当用户确认收货自动结算该订单 时间单位(分钟)</a-span>
                </a-form-model-item>
            </a-form-model>

        </div>
        <div class="admin_form">
            <a-form-model :label-col="{ span: 6 }" :wrapper-col="{ span: 12 }">
                <a-form-model-item :wrapper-col="{ span: 12, offset: 5 }">
                    <a-button type="primary" @click="handleSubmit">提交</a-button>
                </a-form-model-item>
            </a-form-model>
        </div>
    </div>
</template>

<script>
export default {
    components: {},
    props: {},
    data() {
        return {
            info: {},
            id: 0,
            options: [],
            areas: [],
            ModalText: 'Content of the modal',
            visible: false,
            confirmLoading: false,
            reason_rejection: ''
        };
    },
    watch: {},
    computed: {},
    methods: {
        handleSubmit() {
            let api = this.$apiHandle(this.$api.PropertyUpdate);
            this.$post(api.url, this.info).then(res => {
                if (res.code == 200) {
                    this.$message.success(res.msg)
                    return this.onload();
                } else {
                    return this.$message.error(res.msg)
                }
            })
        },
        get_info() {
            this.$post(this.$api.PropertyShow).then(res => {
                this.info = res.data;
                this.info.password = null;
            })
        },
        onload() {
            this.get_info();
        },
    },

    created() {
        this.get_info();
    },
    mounted() {
    }
};
</script>
<style lang="scss" scoped>

</style>
